package com.haixiaoke.saas.apartment.service.impl;

import java.util.List;

import com.haixiaoke.saas.common.utils.DateUtils;
import com.haixiaoke.saas.apartment.domain.HouseRequire;
import com.haixiaoke.saas.apartment.mapper.HouseRequireMapper;
import com.haixiaoke.saas.apartment.service.IHouseRequireService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 房间要求Service业务层处理
 * 
 * @author panda
 * @date 2024-03-21
 */
@Service
public class HouseRequireServiceImpl implements IHouseRequireService {
    @Autowired
    private HouseRequireMapper houseRequireMapper;

    /**
     * 查询房间要求
     * 
     * @param id 房间要求主键
     * @return 房间要求
     */
    @Override
    public HouseRequire selectHouseRequireById(Long id) {
        return houseRequireMapper.selectHouseRequireById(id);
    }

    /**
     * 查询房间要求列表
     * 
     * @param houseRequire 房间要求
     * @return 房间要求
     */
    @Override
    public List<HouseRequire> selectHouseRequireList(HouseRequire houseRequire) {
        return houseRequireMapper.selectHouseRequireList(houseRequire);
    }

    /**
     * 新增房间要求
     * 
     * @param houseRequire 房间要求
     * @return 结果
     */
    @Override
    public int insertHouseRequire(HouseRequire houseRequire) {
        houseRequire.setCreateTime(DateUtils.getNowDate());
        return houseRequireMapper.insertHouseRequire(houseRequire);
    }

    /**
     * 修改房间要求
     * 
     * @param houseRequire 房间要求
     * @return 结果
     */
    @Override
    public int updateHouseRequire(HouseRequire houseRequire) {
        houseRequire.setUpdateTime(DateUtils.getNowDate());
        return houseRequireMapper.updateHouseRequire(houseRequire);
    }

    /**
     * 批量删除房间要求
     * 
     * @param ids 需要删除的房间要求主键
     * @return 结果
     */
    @Override
    public int deleteHouseRequireByIds(Long[] ids) {
        return houseRequireMapper.deleteHouseRequireByIds(ids);
    }

    /**
     * 删除房间要求信息
     * 
     * @param id 房间要求主键
     * @return 结果
     */
    @Override
    public int deleteHouseRequireById(Long id) {
        return houseRequireMapper.deleteHouseRequireById(id);
    }

    @Override
    public List<HouseRequire> selectHouseRequireByHouseId(String houseId) {
        return houseRequireMapper.selectHouseRequireByHouseId(houseId);
    }

    @Override
    public int insertBatchHouseRequire(List<HouseRequire> houseRequireList) {
        return houseRequireMapper.insertBatchHouseRequire(houseRequireList);
    }

    @Override
    public int updateBatchHouseRequire(List<HouseRequire> houseRequireList) {
        return houseRequireMapper.updateBatchHouseRequire(houseRequireList);
    }
}
